<template>
    <a-space wrap>
        <a-tooltip v-for="item in Btns" :title="item.title">
            <Btn :type="item.type" :shape="item.shape" :danger="item.danger"
                :icon="item.icon ? h(item.icon as Component) : null" @click="item.clickFn">
                <template v-if="item.icon">
                </template>
                <template v-else>
                    {{ item.title }}
                </template>
            </Btn>
        </a-tooltip>
    </a-space>
</template>
<script lang='ts' setup>
import { h, inject, type Component } from 'vue'
interface BtnType {
    title?: string
    type?: string
    shape?: string
    danger?: boolean
    size?: string
    block?: boolean
    ghost?: boolean
    loading?: boolean
    icon?: Function | Component
    permission?: string
    clickFn?: () => void
}

const BtnsObj: {
    currentRouteMeta: string[],
    Btns: BtnType[]
} = inject('permissionBtns')!
const { Btns } = BtnsObj

// console.log('BtnsObj', Btns);
</script>
<style scoped></style>